package behavioral.strategy;

/**
 * @ClassName: Context
 * @Description: 上下文类：算法调用者
 * @Author: liu-hao
 * @Date: 2023-04-13 00:10
 * @Version: 1.0
 **/
public class Context {
    private Strategy strategy;

    public Context(Strategy strategy) {
        this.strategy = strategy;
    }

    // 执行策略算法
    public int executeStrategy(int num1, int num2) {
        return strategy.doOperation(num1, num2);
    }
}
